package xiaoming;

import java.util.Scanner;

public class java_chapter5_JianDaTi_4 {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
		System.out.println("please input an integer(end with 0):");
		int input = in.nextInt();
		int max_current = input;
		int min_current = input;
		int loopinput;
		do {
			System.out.println("please input an integer(end with 0):");
			loopinput = in.nextInt();
			if (loopinput > max_current) {
				max_current = loopinput;
			}
			if (loopinput < min_current) {
				min_current = loopinput;
			}
		} while (loopinput != 0);
		
		System.out.println("max is:" + max_current + " min is:" + min_current);
		
	}
	
}
			


